#include "ogre/Ogre.h"


int main1(void)
{
	Ogre::Root* root=new Ogre::Root("plugins_d.cfg");
// 
// 	if(!root->showConfigDialog())
// 	{
// 		return -1;
// 	}
	root->restoreConfig();
	Ogre::RenderWindow* window=root->initialise(true,"OGre3D Beginner");
	Ogre::SceneManager* sceneManager=root->createSceneManager(Ogre::ST_GENERIC);
	Ogre::Camera* camera=sceneManager->createCamera("Camera");
	camera->setPosition(Ogre::Vector3(0,0,50));
	camera->lookAt(Ogre::Vector3(0,0,0));
	camera->setNearClipDistance(5);


	Ogre::Viewport* viewPort=window->addViewport(camera);
	viewPort->setBackgroundColour(Ogre::ColourValue(0,0,0));
	camera->setAspectRatio(Ogre::Real(viewPort->getActualWidth())/Ogre::Real(viewPort->getActualHeight()));

	Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../../Media/packs/Sinbad.zip","Zip");
	Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

	Ogre::Entity* ent=sceneManager->createEntity("Sinbad.mesh");
	Ogre::SceneNode* sinbadNode=sceneManager->getRootSceneNode()->createChildSceneNode();
	sinbadNode->attachObject(ent);


	root->startRendering();
	return 0;
}